import React from 'react';
import Props from './props.js';
import DataService from './DataService.js'


class ComposingComponents extends React.Component {
	constructor(props){
		super(props);
		this.userArray = DataService.getInstance().getUserService().getUserList();
	}

	line(item){
		return (
			<Props parameter ={item} key={item.id}/>
			);
	}

	list(){
		let renderSet  = new Set();
		this.userArray.forEach((item)=>{
				renderSet.add(this.line(item));
		});
		return renderSet;
	}

	render (){
			return 	(
				<div>
					{this.list()}
				</div>	
			);
	}
}

export default ComposingComponents;